package cursed.server.server;

import java.util.ArrayList;
import java.util.List;

import cursed.server.server.model.instance.PcInstance;

/**
 * 遊戲房類別
 * 掌控所有遊戲房的資訊
 */
public class GameRoom {
	private String R_NAME = "";
	private R_TYPE_ENUM R_TYPE;
	private R_STATUS_ENUM R_STATUS;
	private int P_IN_ROOM_LIMIT = 8;
	private String MASTERFORROOM = ""; 
	private List<PcInstance> roomList = new ArrayList<PcInstance>();
	
	private static enum R_TYPE_ENUM {
		a, b
	}

	private static enum R_STATUS_ENUM {
        on, off
	}

	/**
	 * 控制加入玩家到遊戲房
	 * 
	 * @param pc
	 * @return 1:成功加入 0:加入失敗
	 */
	public byte addPalyer(PcInstance pc) {
		if (roomList.size() >= P_IN_ROOM_LIMIT) {
			return 0;
		} else {
			roomList.add(pc);
			return 1;
		}
	}

	public String getR_NAME() {
		return R_NAME;
	}

	/**
	 * 設定房間名稱
	 * @param name 房名
	 */
	public void setR_NAME(String r_NAME) {
		R_NAME = r_NAME;
	}

	public String getMASTERFORROOM() {
		return MASTERFORROOM;
	}

	public void setMASTERFORROOM(String mASTERFORROOM) {
		MASTERFORROOM = mASTERFORROOM;
	}

	public R_TYPE_ENUM getR_TYPE() {
		return R_TYPE;
	}

	public void setR_TYPE(R_TYPE_ENUM r_TYPE) {
		R_TYPE = r_TYPE;
	}

	public R_STATUS_ENUM getR_STATUS() {
		return R_STATUS;
	}

	public void setR_STATUS(R_STATUS_ENUM r_STATUS) {
		R_STATUS = r_STATUS;
	}
}
